#ifndef HSL_H_
#define HSL_H_

#include<winsock2.h>
#include<ws2def.h>
#include<ws2tcpip.h>
#include<exception>
#ifndef alert
#define alert(s) MessageBox(NULL,s,"alert",MB_OK)
#endif
#pragma comment(lib,"Ws2_32")
namespace hsl
{
//	enum{DEFAULT_PORT=12151};
	const char * DEFAULT_PORT = "12151";
	class SocketCreateError
	{
	public:
		enum type{Server,Client};
	private:
		type typ;
	public:
		SocketCreateError(type t)
		{
			typ=t;
		}
		virtual const char *what()
		{
			return (typ==Server?"Server Create Error":"Client Create Error");
		}
	};
	class Server
	{
		WSADATA wsaData;
		SOCKET ListenSocket = INVALID_SOCKET;
		addrinfo *result = NULL, *ptr = NULL;
		addrinfo hints;
		SOCKET ClientSocket = INVALID_SOCKET;
		
		public:
		
		Server();
	};
}

#endif // HSL_H_
